package com.cn.data.jpa.tool.spring.ioc.bean.annotation;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class IndexService {

    @Autowired
    private NameService nameService;

//    public IndexService(NameService nameService){
//        this.nameService = nameService;
//        this.nameService.init();
//    }

//    public IndexService(){
//        nameService.init();
//    }

//    @PostConstruct
    public void init(){
        System.out.println("index service begin");
//        nameService.init();
    }

    public NameService getNameService(){
        return nameService;
    }

}
